From 1e66efe5169dfad9a0c62ba42fbf31ce977bf49e Mon Sep 17 00:00:00 2001
From: Sebastien Castiel <sebastien@castiel.me>
Date: Tue, 19 Dec 2023 09:36:40 -0500
Subject: Use modal dialogs for expense creation & edition (#10)

* First attemps at using route interception and modals

* Remove route interception

* Make it work

* Use Vaul on small screens

* Improve vaul
---
 src/app/groups/[groupId]/expenses/expense-list.tsx | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

(limited to 'src/app/groups/[groupId]/expenses/expense-list.tsx')

diff --git a/src/app/groups/[groupId]/expenses/expense-list.tsx b/src/app/groups/[groupId]/expenses/expense-list.tsx
index 798a5f8..adc6e7a 100644
--- a/src/app/groups/[groupId]/expenses/expense-list.tsx
+++ b/src/app/groups/[groupId]/expenses/expense-list.tsx
@@ -33,7 +33,9 @@ export function ExpenseList({
           expense.isReimbursement && 'italic',
         )}
         onClick={() => {
-          router.push(`/groups/${groupId}/expenses/${expense.id}/edit`)
+          router.push(`/groups/${groupId}/expenses/${expense.id}/edit`, {
+            scroll: false,
+          })
         }}
       >
         <div>
@@ -66,7 +68,10 @@ export function ExpenseList({
             {currency} {(expense.amount / 100).toFixed(2)}
           </div>
           <Button size="icon" variant="link" className="-my-2" asChild>
-            <Link href={`/groups/${groupId}/expenses/${expense.id}/edit`}>
+            <Link
+              href={`/groups/${groupId}/expenses/${expense.id}/edit`}
+              scroll={false}
+            >
               <ChevronRight className="w-4 h-4" />
             </Link>
           </Button>
-- 
cgit v1.3

